class AdminUser < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable,
         :recoverable, :rememberable, :trackable, :validatable
  has_many :abilities
  accepts_nested_attributes_for :abilities, allow_destroy: true, reject_if: proc {|attributes|
    attributes['name'].blank? or attributes['access'].length==1
  }
end
